import React from "react";
import './index.css';
import Introduce from '../../Common/svg/Introduce';

// 热点页面左边的图标
export default class InformationBook extends React.Component{
    constructor(props){
        super();
        this.state={
            text:props.text,
            subtext:props.subtext,
            img:props.img,

        }
    }
    UNSAFE_componentWillReceiveProps(props){
        this.setState({
            text:props.text,
            subtext:props.subtext,
            img:props.img,
        });
    }
    // 资料书组件
    render(){
        // console.log(this.sstate.img);
        let imgNode=this.state.img===undefined? <Introduce width="64px" height="64px" radius="11"/> :<img src={this.state.img} alt="logo" style={{width:"64px", height:"64px"}}/>;
        return(
            <div className="InformationBook_Body">
                <div className="InformationBook_Left">
                    {imgNode}
                    {/* <img src={this.state.img} alt="logo" style={{width:"64px", height:"64px"}}/> */}
                    {/* <Introduce width="64px" height="64px" radius="11"/> */}
                </div>   
                <div className="InformationBook_Right">
                    <div className="InformationBook_text">
                        <span>{this.state.text}</span>
                    </div>
                    <div className="InformationBook_subtext">{this.state.subtext}</div>
                </div>                
            </div>
        )
    }
}